﻿using System;
using Dsl.Ped.Framework.Helpers;

namespace Dsl.Ped.Framework.Extensions 
{
    /// <summary>
    /// Extension methods for the <see cref="Type"/>
    /// </summary>
    public static class TypeExtension 
    {
        /// <summary>
        /// Get the type of the generic type, for instance,
        /// for the instance of IEnumerable of types string returns a type string
        /// </summary>
        /// <param name="type">Generic tyep</param>
        /// <returns>Type of the generic type</returns>
        public static Type GetTypeOrNullableUnderlyingType(this Type type)
        {
            return TypeHelper.GetTypeOrNullableUnderlyingType(type);
        }
    }
}
